package cn.gzsf.sboot06.controller;


import cn.gzsf.sboot06.entity.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AxiosController {

    @RequestMapping("/helloAxios")
    public String hello(String info){
        return "接收到了请求!info="+info;
    }

    @RequestMapping("/reg")
    public String reg(User user){
        System.out.println("user = " + user);
        return "注册成功";
    }

    @RequestMapping("/check")
    public int check(String username){
        if(username.equals("tom")){
            return 2;//代表已存在
        }
        return 1;//代表可用
    }

}
